package com.example.demo.utils.enu;

public enum SubmissionEnum {
    In_Queue("1", "队列中"),
    Processing("2", "处理中"),
    Accepted("3", "通过"),
    Wrong_Answer("4", "答案错误"),
    Time_Limit_Exceeded("5", "运行超时"),
    Compilation_Error("6", "编译错误"),
    Runtime_Error_SIGSEGV("7", "运行时错误"),
    Runtime_Error_SIGXFSZ("8", "运行时错误"),
    Runtime_Error_SIGFPE("9", "运行时错误"),
    Runtime_Error_SIGABRT("10", "运行时错误"),
    Runtime_Error_NZEC("11", "运行时错误"),
    Runtime_Error_Other("12", "运行时错误"),
    Internal_Error("13", "内部错误"),
    Exec_Format_Error("14", "执行文件格式错误");

    private SubmissionEnum(String value, String desc) {
        this.setValue(value);
        this.setDesc(desc);
    }

    private String value;
    private String desc;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String valueToDesc(String value) {
        {
            switch (value) {
                case "1":
                    return SubmissionEnum.In_Queue.getDesc();
                case "2":
                    return (SubmissionEnum.Processing.getDesc());
                case "3":
                    return (SubmissionEnum.Accepted.getDesc());
                case "4":
                    return (SubmissionEnum.Wrong_Answer.getDesc());
                case "5":
                    return SubmissionEnum.Time_Limit_Exceeded.getDesc();
                case "6":
                    return SubmissionEnum.Compilation_Error.getDesc();
                case "7":
                    return SubmissionEnum.Runtime_Error_SIGSEGV.getDesc();
                case "8":
                    return SubmissionEnum.Runtime_Error_SIGXFSZ.getDesc();
                case "9":
                    return SubmissionEnum.Runtime_Error_SIGFPE.getDesc();
                case "10":
                    return SubmissionEnum.Runtime_Error_SIGABRT.getDesc();
                case "11":
                    return SubmissionEnum.Runtime_Error_NZEC.getDesc();
                case "12":
                    return SubmissionEnum.Runtime_Error_Other.getDesc();
                case "13":
                    return SubmissionEnum.Internal_Error.getDesc();
                case "14":
                    return SubmissionEnum.Exec_Format_Error.getDesc();
                default:
                    return null;
            }
        }
    }
}
